﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<SimpleWebServices.Web.IResource>" %>
<%
    if (null != this.Model)
    {
%>
        <title><%=Tenant.HtmlEncode(this.Model.Title)%></title>
<%
        string language = System.Threading.Thread.CurrentThread.CurrentUICulture.Name;
%>
        <meta http-equiv='Content-Language' content='<%=HttpUtility.HtmlEncode(language)%>' />
        <meta name='DC.language' scheme='RFC1766' content='<%=HttpUtility.HtmlEncode(language)%>' />
<%
        if (!string.IsNullOrEmpty(this.Model.Description))
        {
%>
            <meta name='description' content='<%=Tenant.HtmlEncode(this.Model.Description)%>' />
            <meta name='DC.description' content='<%=Tenant.HtmlEncode(this.Model.Description)%>' />
<%
        }

        string path = HttpContextFactory.Current.Request.Path;
        if (path.EndsWith(".html"))
        {
%>
            <link rel='alternate' href='<%=path.Substring(0, path.Length - ".html".Length) + ".xhtml"%>' type='application/xhtml+xml' title='<%=Tenant.HtmlEncode(this.Model.Title)%>' />
<%
        }
        else if (path.EndsWith(".xhtml"))
        {
%>
            <link rel='alternate' href='<%=path.Substring(0, path.Length - ".xhtml".Length) + ".html"%>' type='text/html' title='<%=Tenant.HtmlEncode(this.Model.Title)%>' />
<%
        }
        
        if (null != this.Model.Links)
        {
            foreach (var item in this.Model.Links)
            {
                %><%=item.Serialize().CreateNavigator().OuterXml%><%
            }
        }

        if (null != this.Model.Metadata)
        {
            foreach (var item in this.Model.Metadata)
            {
                %><%=item.Serialize().CreateNavigator().OuterXml%><%
            }
        }
    }
%>